﻿<%@ Page Title="注册" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Register.aspx.cs" Inherits="StudentAppointmentPlatform.Account.Register" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    
</asp:Content>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:ScriptManager runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="upRegister" runat="server">
        <ContentTemplate>
            <h2>创建新帐户
            </h2>
            <p>
                使用以下表单创建新帐户。
            </p>
            <p>
                密码的长度至少必须为 6 个字符。
            </p>
            <span class="failureNotification">
                <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
            </span>
            <asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification"
                ValidationGroup="RegisterUserValidationGroup" />
            <div class="accountInfo">
                <fieldset class="register">
                    <legend>帐户信息</legend>
                    <p>
                        <asp:Label ID="UserIdLabel" runat="server" AssociatedControlID="UserId">用户编号:</asp:Label>
                        <asp:TextBox ID="UserId" runat="server" CssClass="textEntry" Enabled="False"></asp:TextBox>
                    </p>
                    <p>
                        <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">用户名:</asp:Label>
                        <asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                            CssClass="failureNotification" ErrorMessage="必须填写“用户名”。" ToolTip="必须填写“用户名”。"
                            ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </p>
                    <p>
                        <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">电子邮件:</asp:Label>
                        <asp:TextBox ID="Email" runat="server" CssClass="textEntry"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                            CssClass="failureNotification" ErrorMessage="必须填写“电子邮件”。" ToolTip="必须填写“电子邮件”。"
                            ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </p>
                    <p>
                        <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">密码:</asp:Label>
                        <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                            CssClass="failureNotification" ErrorMessage="必须填写“密码”。" ToolTip="必须填写“密码”。"
                            ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </p>
                    <p>
                        <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">确认密码:</asp:Label>
                        <asp:TextBox ID="ConfirmPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ControlToValidate="ConfirmPassword" CssClass="failureNotification" Display="Dynamic"
                            ErrorMessage="必须填写“确认密码”。" ID="ConfirmPasswordRequired" runat="server"
                            ToolTip="必须填写“确认密码”。" ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                        <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword"
                            CssClass="failureNotification" Display="Dynamic" ErrorMessage="“密码”和“确认密码”必须匹配。"
                            ValidationGroup="RegisterUserValidationGroup">*</asp:CompareValidator>
                    </p>
                    <p>
                        <asp:Label ID="TelephoneLabel" runat="server" AssociatedControlID="Telephone">座机号码:</asp:Label>
                        <asp:TextBox ID="Telephone" runat="server" CssClass="textEntry"></asp:TextBox>
                    </p>
                    <p>
                        <asp:Label ID="CellphoneLabel" runat="server" AssociatedControlID="Cellphone">手机号码:</asp:Label>
                        <asp:TextBox ID="Cellphone" runat="server" CssClass="textEntry"></asp:TextBox>
                    </p>
                    <p>
                        <asp:Label ID="TypeLabel" runat="server" AssociatedControlID="RB_Stu">注册类型:</asp:Label>                            
                        <asp:RadioButton runat="server" ID="RB_Stu" Text="学生" TextAlign="Left" CssClass="aspRB_Type" GroupName="type" Checked="True"/>
                        <asp:RadioButton runat="server" ID="RB_Dir" Text="负责人" TextAlign="Left" CssClass="aspRB_Type" GroupName="type"/>                     
                    </p>
                </fieldset>
                <p class="submitButton">
                    <asp:Button ID="CreateUserButton" runat="server" OnClick="CreateUserButton_OnClick" Text="创建用户"
                        ValidationGroup="RegisterUserValidationGroup" />
                </p>
            </div>
        </ContentTemplate>
        <Triggers>
            <%-- 使用了UpdatePanel，如果不加这个，有可能JS弹窗弹不出来 --%>
            <asp:PostBackTrigger ControlID="CreateUserButton" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
